<template>
	<view class="page-fade-in" :style="{opacity: pageOpc}">
		<template v-if="pageOpc">
			<view class="sign-box flexWarpCenterColumn">
				<view class="title">签章链接:</view>
				<view class="link">{{allUrl}}</view>
				<view class="remaks-box">请复制到浏览器中进行签约</view>
				<view class="copy-btn" @tap="copy()">复制链接</view>
			</view>
		</template>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				pageOpc:0,
				allUrl:'',
			}
		},
		onReady() {
			setTimeout(() => {
				this.pageOpc = 1
			}, 100)
		},
		onLoad() {
			this.getPdfUrl()
		},
		methods:{
			// 获取协议地址
			getPdfUrl(){
				this.$request.post(this.$api.getUrlSign, {
					store_id:uni.getStorageSync('store_id'),
				}, {
					token:true
				}).then(res => {
					if(res.code==1){
						let {
							data = {}
						} = res;
						this.allUrl=data.sign_url
					}
				})
			},
			copy(){
				uni.setClipboardData({
					data:this.allUrl,
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	.sign-box{
		font-size: 28upx;
		color: #fff;
		padding: 30upx;
		.title{
			text-align: center;
		}
		.link{
			word-break:break-all;
			line-height: 40upx;
			margin-top: 20upx;
		}
	}
	.copy-btn{
		font-size: 30rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 70rpx;
		width: 210rpx;
		height: 70rpx;
		background: #26BCFD;
		border-radius: 16rpx;
		text-align: center;
		z-index: 999;
		margin-top: 30upx;
	}
	.remaks-box {
		font-size: 28rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #82819B;
		line-height: 40rpx;
		margin-top: 12upx;
		line-break: anywhere;
	}
	.bottom-box{
		height: 140rpx;
		background: #1D1C5C;
		border-top: 1rpx solid #232428;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		margin: auto;
		padding: 30upx 40upx;
		visibility: visible!important;
		z-index: 99999;
		.bottom-btn{
			height: 96rpx;
			line-height: 96rpx;
			background: #598FFF;
			border-radius: 48rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 34rpx;
			color: #FFFFFF;
			line-height: 96rpx;
			text-align: center;
			font-style: normal;
			text-transform: none;
		}
	}
	.webView{
		width: 100%;
		height: 100vh;
	}
</style>